Repository navigation
Make the boot test container a container, so the first boot finishes - #9
Merged
Merged
Conversation
…ishes
With the republished layer the gate boots the appliance and the first boot
stops in firstboot.d/40nodebb, which never returns. The node process running
"./nodebb setup" is asleep in n_tty_write:
[<0>] wait_woken+0x52/0x60
[<0>] n_tty_write+0x406/0x500
[<0>] file_tty_write.isra.0+0x175/0x2c0
The layer ships the plain appliance inithooks.service, which runs the hooks
with StandardOutput=tty on /dev/tty1. A real container image does not: the
headless unit is skipped on the lxc marker and the container patch sets
REDIRECT_OUTPUT=true. Nothing reads tty1 in a container nobody has attached
to, so the terminal buffer fills and the write blocks. The setup prints well
past the buffer.
The test wrote only the marker, so its container was a container to keel
inspect and an appliance on a console to systemd. bt_mark_container now does
all three things a container build does: the marker, REDIRECT_OUTPUT=true in
etc/default/inithooks, and a drop-in giving inithooks.service
StandardOutput=journal.
Measured on the build host against the published chain: the first boot runs
to 98finalize, [40nodebb] successfully completed, port 80 answers 307 to
https and port 443 answers 200 with <title>Home | NodeBB</title> over IPv6.
15regen-sslcert and 95secupdates, which also reported failures while the
console was blocked, now complete too.
Six tests for bt_mark_container; boot-test-lib.sh stays at 100 percent
(137/137). Nothing in the layer changes, so no changelog entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the republished chain the gate pulls, verifies, assembles and boots, and
then stops:
[40nodebb] runningis the last line of the container'sinithooks log and the hook never returns. The node process running
./nodebb setupis asleep in a write to the terminal:/proc/<pid>/fd/1 -> /dev/lxc/tty1.Why
The layer ships the plain appliance
inithooks.service:A real container image does not run that unit. buildtasks' headless patch
carries
ConditionPathExists=!/var/lib/turnkey-info/inithooks.service/lxc,and
patches/container/confsetsREDIRECT_OUTPUT=true. Nothing reads tty1in a container nobody has attached to, so once the terminal buffer fills the
write blocks forever, and
./nodebb setupprints well past it.The boot test wrote only the marker file, so its container was a container to
keel inspectand an appliance on a console to systemd. That went unnoticedwhile the published layer could not finish its first boot at all.
What changes
bt_mark_containerreplaces the bareinstallof the marker and does thethree things a container build does:
/var/lib/turnkey-info,REDIRECT_OUTPUT=trueinetc/default/inithooks, the same editpatches/container/confmakes,inithooks.serviceStandardOutput=journal, which iswhat keeps the hooks off tty1.
Nothing in the layer changes, so there is no changelog entry.
Measured
On the build host, against the chain now on the mirror, in a container
assembled and booted the way the gate does it:
15regen-sslcertand95secupdateshad also been reporting failures whilethe console was blocked; both complete now.
Test plan:
bats tests/boot-test.bats, 41 tests, six added forbt_mark_containertests/coverage.sh: boot-test-lib.sh 137/137, every measured file at orabove the threshold of 95
shellcheck -S warningcleanappliance / build-and-booton main